<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>模块列表</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<jsp:include page="../include.jsp" />
</head>
<body class="list">
	<div class="bar">
		模块列表&nbsp;总记录数: ${pager.totalCount} (共${pager.pageCount}页)
	</div>
	<div class="body">
		<form id="listForm" action="module.do" method="post">
			<div class="listBar">
				<input type="button" class="formButton" id="add" value="上传模块" hidefocus disabled="disabled"/>
				&nbsp;&nbsp;
				<label>查找: </label>
				<select name="searchBy">
					<option value="moduleName"> 
						模块名称
					</option>
				</select>
				<input type="text" name="keyword" value="${pager.keyword}" />
				<input type="button" id="searchButton" class="formButton" value="搜 索" hidefocus />
				&nbsp;&nbsp;
				<label>每页显示: </label>
				<select name="pageSize" id="pageSize">
					<option value="10"<c:if test="${pager.pageSize eq 10}"> selected="selected"</c:if>>
						10
					</option>
					<option value="1"<c:if test="${pager.pageSize eq 1}"> selected="selected"</c:if>>
						1
					</option>
					<option value="20"<c:if test="${pager.pageSize eq 20}"> selected="selected"</c:if>>
						20
					</option>
					<option value="50"<c:if test="${pager.pageSize eq 50}"> selected="selected"</c:if>>
						50
					</option>
					<option value="100"<c:if test="${pager.pageSize eq 100}"> selected="selected"</c:if>>
						100
					</option>
				</select>
			</div>
			<table id="listTable" class="listTable">
				<tr>
					<th class="check">
						<input type="checkbox" class="allCheck"/>
					</th>
					<th>
						<a href="#" class="sort" name="moduleName" hidefocus>模块名称</a>
					</th>
					<th>
						<a href="#" class="sort" name="moduleSlot" hidefocus>模块slot</a>
					</th>
					<th>
						<a href="#" class="sort" name="moduleUnzip" hidefocus>是否解压</a>
					</th>
					<th>
						<a href="#" class="sort" name="moduleServices" hidefocus>服务数</a>
					</th>
					<th>
						<a href="#" class="sort" name="modulePath" hidefocus>模块路径</a>
					</th>
					<th>
						<span>操作</span>
					</th>
				</tr>
				<c:forEach items="${pager.list}" var="module">
					<tr>
						<td>
							<input type="checkbox" name="ids" value="${module.moduleName}:${module.moduleSlot}" 
							<c:if test="${fn:contains(module.moduleName,'org.dding.admin')}">disabled="disabled" title="管理模块不能删除"</c:if>/>
						</td>
						<td>
							<span title="${module.moduleName}">${module.moduleName}
							</span>
						</td>
						<td>
							${module.moduleSlot}
						</td>
						<td>
							${module.unzip}
						</td>
						<td>
							<a href="../serviceAction/service.do?searchBy=moduleName&keyword=${module.moduleName}:${module.moduleSlot}">${module.serviceNum}</a>
						</td>
						<td>
							${module.modulePath}
						</td>
						<td>
							<a href="view.do?id=${module.moduleName}:${module.moduleSlot}" title="浏览">[浏览]</a>
							<a href="javascript:relink('${module.moduleName}','relink.do')" title="连接">[连接]</a>
						</td>
					</tr>
				</c:forEach>
			</table>
			<c:choose>
				<c:when test="${fn:length(pager.list)!=0}">
					<div class="pagerBar">
						<div class="delete">
							<input type="button" id="deleteButton" class="formButton" url="unloadModule.do" value="卸载模块" disabled hidefocus />
						</div>
						<div class="pager">
							<jsp:include page="../common/pager.jsp" />
						</div>
					</div>
				</c:when>
				<c:otherwise>
					<div class="noRecord">没有找到任何记录!</div>
				</c:otherwise>
			</c:choose>
		</form>
	</div>
</body>
</html>